#ifndef WORKSPACE_H
#define WORKSPACE_H

#include<QString>
#include"Acteur.h"

namespace IAlib
{
    class IA_LIBSHARED_EXPORT WorkSpace
    {
    public:
        enum WORK_SPACE_TYPE
        {
            WS_TYPE_UNDEF,
            WS_TYPE_WORLD,
            WS_TYPE_ROOM,
            WS_TYPE_OPEN_AREA,
            WS_TYPE_OTHER
        };

        WorkSpace();
        WorkSpace(const WorkSpace& workspace);

        ///------------------  getters & setters  -------------------------------------------

        void setID(const QString& id) { m_id = id; }
        QString getID() const { return m_id;}

        void setDescription(const QString& description) { m_description = description; }
        QString getDescription() const { return m_description;}

        void setType(const WORK_SPACE_TYPE type) { m_type = type; }
        WORK_SPACE_TYPE getType() const { return m_type; }

        void setParent(const QString& parent) { m_parent = parent; }
        QString getParent() const { return m_parent; }

        void setStep(const quint64 step) { m_step = step; }
        quint64 getStep() const { return m_step; }

        void setHeight(const float h) { m_height = h; }
        float getHeight() const { return m_height; }

        void setWidth(const float w) { m_width = w; }
        float getWidth() const { return m_width; }

        void setLength(const float l) { m_length = l; }
        float getLength() const { return m_length; }

        void setArea(const float length, const float height, const float width);

        void addActor(Acteur * actor);
        void removeActor(const QString& actor_id);

        void addArtefact(Artefact *artefact);
        void removeArtefact(const QString& artefact_id);


        //------------------------------------------------------------------------------------

        void updateActorSense(const float d); //d represents the distance of perception

        QDomElement toXML(QDomDocument &doc);
        void        fromXML(QDomElement ele);

    private:

        QString         m_id;
        QString         m_description;
        WORK_SPACE_TYPE m_type;
        QString         m_parent;

        float           m_length;
        float           m_width;
        float           m_height;

        quint64         m_step;

        QMap<QString, Acteur*>   m_actors;
        QMap<QString, Artefact*> m_artefacts;


    };
}

#endif // WORKSPACE_H
